﻿//
//  EntryState
//
//  Created by Codyo on 2008-07-05.
//  Copyright (c) 2008 Codyo. All rights reserved.
//

import com.codyo.mobileStateMachine.MobileStateMachine;
import com.codyo.mobileStateMachine.AbstractState;

class com.codyo.states.GameResponseState extends AbstractState{
	
	private var stateMachine:MobileStateMachine;
	
	private var theStage:MovieClip;
	private var change_interval:Number;
	
	function GameResponseState(stateMachine:MobileStateMachine){
		this.stateMachine = stateMachine;
		
		trace("game response state entered");
		doResponse();
		change_interval = setInterval(this, "doResponse", 1500);
	}
	
	public function keypadPressed(theKey:String):Void{
		theStage = this.stateMachine.getStage();	//need to move this
		switch(theKey){
			
			default:
				trace("ENTRY - key press not assigned");
				theStage.readout_txt.text = "ENTRY - key not assigned pressed: "+theKey;
				break;
			
		}
	}
	private function doResponse():Void{
		stateMachine.setState(MobileStateMachine.GAME_PLAY_STATE);
	}
}